#ifndef CAMERA_H
#define CAMERA_H

#include "point.h"
#include "vector.h"
#include "glframe.h"

class ProjectionPlane {
public:
    ProjectionPlane() : left_(0.0), bottom_(0.0), right_(0.0), top_(0.0), distance_from_camera_(0.0) { }
    ProjectionPlane(double left, double bottom, double right, double top, double distance_from_camera) :
            left_(left), bottom_(bottom), right_(right), top_(top), distance_from_camera_(distance_from_camera) { }

    double left() const { return left_; }
    double right() const { return right_; }
    double bottom() const { return bottom_; }
    double top() const { return top_; }
    double distance_from_camera() const { return distance_from_camera_; }

private:
    double left_, bottom_, right_, top_, distance_from_camera_;
};

class Camera
{
public:
    Camera();
    Camera(const Point &origin, const Vector &lookAt, const Vector &up, const ProjectionPlane &projection_plane);
    Camera(const Point &origin, const Point &lookAt, const Vector &up, const ProjectionPlane &projection_plane);
    Camera(const Camera &c);

    Camera& operator=(const Camera& c);

    const Point& origin() const;
    const Point& lookAt() const;
    const Vector& up() const;
    const ProjectionPlane& projection_plane() const;
    const Vector& i() const;
    const Vector& j() const;
    const Vector& k() const;
    GlFrame frame() const;

private:
    Point origin_;
    Point lookAt_;
    Vector up_;
    ProjectionPlane pplane_;
    Vector i_, j_, k_;
};

#endif // CAMERA_H
